<?php

namespace app\models\user;

use Yii;

/**
 * This is the model class for table "user_account".
 *
 * @property int $id
 * @property int $user_id
 * @property float $balance 余额(售后规则不同,可能出现负数)
 * @property float $score 积分
 * @property float $ticket 购物券(线下消费)
 * @property float $platform_ticket 平台券(充值获得)
 * @property float $tmp_score 临时积分
 * @property float $await_balance 待返余额(佣金)
 * @property float $done_balance 已返
 * @property float $lock_balance 锁定 - 余额
 * @property float $lock_score 锁定 - 积分
 * @property float $lock_ticket 锁定 - 购物券
 * @property float $lock_platform_ticket 锁定 - 平台券
 */
class UserAccount extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return 'user_account';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['user_id'], 'integer'],
            [['balance', 'score', 'ticket', 'platform_ticket', 'tmp_score', 'await_balance', 'done_balance', 'lock_balance', 'lock_score', 'lock_ticket', 'lock_platform_ticket'], 'number'],
            [['user_id'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'balance' => 'Balance',
            'score' => 'Score',
            'ticket' => 'Ticket',
            'platform_ticket' => 'Platform Ticket',
            'tmp_score' => 'Tmp Score',
            'await_balance' => 'Await Balance',
            'done_balance' => 'Done Balance',
            'lock_balance' => 'Lock Balance',
            'lock_score' => 'Lock Score',
            'lock_ticket' => 'Lock Ticket',
            'lock_platform_ticket' => 'Lock Platform Ticket',
        ];
    }
}
